<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-3.3.1.min.js"></script>
</head>

<body>
    <div id="Odiv">
        <p id="p1">我是第一行内容</p>
        <p id="p2">我是第二行内容</p>
        <p id="p3">我是第三行内容</p>
        <p id="p4">我是第四行内容</p>
    </div>
    <input type="button" value="将第2行内容替换为JavaScript课程" onClick="replaceNode()" id="btn" />
    <script>
        $("#btn").click(function() {
            $("#p2").html("JavaScript课程");
        });
    </script>

</body>

</html>